package com.sskj.cndragon.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.cndragon.bean.AddressBean;
import com.sskj.cndragon.bean.AwardBean;
import com.sskj.cndragon.ui.activity.WinningRecordActivity;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonConverter;

import java.util.List;

import io.reactivex.Flowable;


public class WinningRecordActivityPresenter extends BasePresenter<WinningRecordActivity> {

    public Flowable<List<AwardBean>> getAwardRecord(String userID) {
        return httpService.getAwardRecord(userID)
                .tag(this)
                .converter(new JsonConverter<HttpData<List<AwardBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData());
    }
}
